import { createRouter, createWebHistory } from 'vue-router'
import RegisterView from '@/views/Register/index.vue'
import LoginView from '@/views/Login/index.vue'
import SsView from '@/views/ss/index.vue'
import XqView from '@/views/xq/index.vue'
import HomeView from '@/views/Home/index.vue'
import IndexView from '@/views/Home/home.vue'
import ClassView from '@/views/Home/class.vue'
import CartView from '@/views/Home/cart.vue'
import MyView from '@/views/Home/my.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
     { path: '/', redirect: '/home/home' },
    {
      path: '/register',
      component: RegisterView,
    },
     {
      path: '/login',
      component: LoginView,
    },
    {
      path: '/ss',
      component: SsView,
    },
    {
      path: '/xq',
      component: XqView,
    },

     {
      path: '/home',
      component: HomeView,
       children:[
            {
            path: 'home',
            component: IndexView,
        },
        {
            path: 'class',
            component: ClassView,
        },
         {
            path: 'cart',
            component: CartView,
        },
         {
            path: 'my',
            component: MyView,
        },
       ]
    },
  ],
})

export default router
